<?php
header('Content-type: text/html; charset=utf-8');
include ('conn/conn.php');
$type = $_POST[td_type];
if ($type=="" || $type == null){
	echo "<script type=\"text/javascript\">alert('分类不能为空,请重新填写！');history.back();</script>";
}else {
	$sql = mysql_query("insert into tb_type(type) values('$type')");
	if ($sql){
		echo "<script type=\"text/javascript\">alert('恭喜你，数据上传成功');window.location.href='style.php';</script>";
	}else {
		echo "<script type=\"text/javascript\">alert('数据上传失败');window.location.href='style.php';</script>";
	}
}